[Top] [Prev] [Next] [Bottom] [Contents]

SaMalloc

Functional equivalent of malloc, but Sapphire will garbage collect the memory after handling the current request. Therefore, don't free it or hold onto after a request.

Synopsis

#include "SaRnHtml.h"
void* SaMalloc SUTPROTO((unsigned size));

Arguments

size
number specifying the amount of memory, in bytes, to allocate.

Return Values

A chunk of uninitialized memory.

Description

Functional equivalent of malloc, but Sapphire will garbage collect the memory after handling the current request, so don't free it or hold onto after a request. If you wish to free it prematurely, use SaFree.

Example

char* str;
str = (char*) SaMalloc(1024 * sizeof(char));
will malloc out a chunk of memory large enough to hold 1024 characters. Sapphire application servers will clean up the memory for this chunk at the end of a request. So don't free it or hold onto after a request.

See Also



[Top] [Prev] [Next] [Bottom] [Contents]

info@bluestone.com
Copyright © 1997, Bluestone. All rights reserved.